package com.example.ceramics;

import android.content.Context;
import android.util.Log;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import com.example.ceramics.database.dao.ITableDao;
import com.example.ceramics.database.dao.TableDaoImpl;
import com.example.ceramics.database.dao.UserDaoImpl;
import com.example.ceramics.entity.UserEntity;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertEquals;

@RunWith(AndroidJUnit4.class)
public class TestTable {

    private ITableDao tableDao;

    @Before
    public void testPrepare() {
        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
        tableDao = new TableDaoImpl(appContext);
    }

    @Test
    public void testTableUser() {
        tableDao.deleteTableUser();
        tableDao.createTableUser();
    }

    @Test
    public void testTableGoods() {
        tableDao.deleteTableGoods();
        tableDao.createTableGoods();
    }

    @Test
    public void testTableCart() {
        tableDao.deleteTableCart();
        tableDao.createTableCart();
    }

    @Test
    public void testTableOrder() {
        tableDao.deleteTableOrder();
        tableDao.createTableOrder();
    }
}
